{% extends "base_template.html" %}

{% block meta-title %}Admin{% endblock %}
{% block meta-keywords %}ace oil admin, management{% endblock %}
{% block meta-desc %}Administer customer inquiries and current oil delivery price{% endblock %}

{% block main-content %}
  <div class="column prepend-1 span-22">
  <h2>{{ page_title }}</h2>
  	<p><a href="/">Home</a></p>
    <p>Welcome to the {{ site_name }} Administration Dashboard.  Here you will be able to add a new oil prices and view existing customer inquiries.</p>
    <div class="column span-11">
      <h3>Current Price</h3>
      {% for oil_price in oil_prices %}
        <div class="price_unit">
          <span>${{ oil_price.price }}</span> per gallon
        </div>
        <p>{% if oil_price.author %}
          Added by <strong>{{ oil_price.author }}</strong> on {{ oil_price.date|date:_("m/d/y h:i:s") }}
        {% else %}
         Added by <strong>Anonymous</strong> on {{ oil_price.date|date:_("m/d/y h:i:s") }}
        {% endif %}</p> 
      {% endfor %}
      <p><a href="#AddPrice" title="Add A New Price" onclick="$j('#AddPrice').show();">Add New Price</a>
    </div>
    <div id="AddPrice" class="column span-11">
      <h3>Add a new Price</h3>
      <form method="post" action="/pricing">
        <fieldset>
          <div><label for="company">Oil Price</label></div>
          <div>$ <input type="text" name="price"/> per gallon</div>
          <div><small>Insert decimal price only <em>(ie- 1.55)</em></small></div>
          <div><input type="submit" value="Send"/> or <a href="#" onclick="$j('#AddPrice').hide();">Cancel</a></div>
        
        </fieldset>
      </form>
      <script type="text/javascript">
        $j("#AddPrice").hide();
      </script>
    </div>
    <hr class="clearfix"/>
    <h3>Inquiries</h3>
    <p>Below you'll find the <strong>latest 30</strong> inquiries submitted via the contact form.  You should have received these as emails but they are stored in the database and listed here for your reference.</p>
    <table class="altRows">
      <thead>
        <tr>
          <th>Name</th>
          <th>Phone</th>
          <th>Email Address</th>
          <th>Comments/Question</th>
          <th>Date</th>
          <!--th>Status</th-->
        </tr>
      </thead>
    {% for inquiry in inquiries %}
      <tr>
        <td>{{ inquiry.author }}</td>
        <td>{{ inquiry.phone }}</td>
        <td><a href="mailto:{{ inquiry.author_email }}" target="_blank">{{ inquiry.author_email }}</a></td>
        <td>{{ inquiry.description }}</td>
        <td>{{ inquiry.date|date:_("m/d/y") }}</td>
        <!--td>
          {% if inquiry.is_open %}
            <strong>Open</strong>
          {% else %}
            Closed
          {% endif %}
        </td-->
      </tr>
    {% endfor %}
    </table>
  </div>
{% endblock %}
{% block sidebar %}{% endblock %}